// pages/mybokee/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    time:'',
    imgList:[
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/1.jpeg?sign=85d89c02ca6eb615dfc435c32c53fa60&t=1737446355',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/2.jpeg?sign=d14a3adbbadc0ab958f8de4bbebd08be&t=1737446365',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/3.jpeg?sign=9f6bff2cbd4299138dd18395f82db25c&t=1737446371',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/4.jpeg?sign=45ffdb862ff4a725561d626743921a0b&t=1737446377',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/5.jpeg?sign=8486ffad1054c3d3ed53e3cf89830b88&t=1737446382',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/6.heic?sign=d65c08354de7b4b5ac26f2b98ac6d2da&t=1737446391',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/7.heic?sign=e65a25c6685dcac56feab60b35180727&t=1737446397',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/8.jpeg?sign=d8eaf8f967106f49e1790eafc92d7eb4&t=1737446403',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/IMG_5867.JPG?sign=21c3e92458c2047a3653b8f1bcce88b4&t=1737446504',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/bg.jpeg?sign=2a37efbb91b3dbf69ae8c0d4f3107d1c&t=1737446530',
      'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/lizhen.jpg?sign=dd7b9ffbc6e7f86bc7622fc693e3d3d1&t=1737446543',
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    setInterval(()=>{
      this.updateClock()
    },1000)
  },
  getImage(){
    let that = this
    wx.chooseMedia({
      count: 11,
      mediaType: ['image'],
      sourceType: ['album'],
      success(res) {
        let fileList=res.tempFiles.map(v=>v.tempFilePath)
        if(fileList.length < 11){
          fileList = fileList.concat(that.data.imgList.slice(0,(11 - fileList.length)))
        }
        that.setData({
          imgList:fileList
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },
   updateClock() {
    const now = new Date();
    const hours = now.getHours().toString().padStart(2, '0');
    const minutes = now.getMinutes().toString().padStart(2, '0');
    const seconds = now.getSeconds().toString().padStart(2, '0');
    this.setData({
      time:`${hours}:${minutes}:${seconds}`
    })
  },  
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})